import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;
import java.util.Map;
import java.util.Optional;


@WebServlet(urlPatterns = {"/login/dgut"})

public class dgut extends HttpServlet{
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        LoginController login=new LoginController();
        Map<String,String> map=login.login(request,response);
        HttpSession session=request.getSession();
        String username = map.get("username");
        String name = map.get("name");
        String group = map.get("group");
        String openid1=map.get("openid1");
        String wx_openid=map.get("wx_openid");
        session.setAttribute("username",username);
        session.setAttribute("name",name);
        session.setAttribute("group",group);
        session.setAttribute("openid1",openid1);
        session.setAttribute("wx_openid",wx_openid);
        request.getRequestDispatcher("/display.jsp").forward(request,response);



    }
}
